import React, { useState, useRef } from 'react'
import { View, Text, TextInput, ScrollView, StyleSheet } from 'react-native';
import { Button, Field, FieldRefType, Radio, RadioGroup,CheckboxGroup,Checkbox } from 'src/mycomponents';
import AntDesign from 'react-native-vector-icons/AntDesign';
export const ButtomC = (props: any) => {
  const [btnDisabled, setBtnDisabled] = useState<boolean>(false);
  const [singleRadio,setSingleRadio] = useState<boolean>(false);
  const [checkStatus,setcheckStatus] = useState<string[]>([]);
  const btnHandel = () => {
    console.log('点我干嘛')
  }
  const radioChange = (val: string) => {
    console.log(val, '46566')
  }
  const options = [
    {
      label: '我的',
      value: '1'
    },
    {
      label: '你的',
      value: '2'
    },
    {
      label: '他的',
      value: '3'
    },
  ]
  const sss = (status:boolean)=>{
    setSingleRadio(status)
  }
  const checkBoxChange = (val:string[])=>{
    setcheckStatus(val)
  }
  return (
    <ScrollView style={{ backgroundColor: '#f2f2f2' }}>
      <Button type='primary' disabled={btnDisabled} onPress={btnHandel}>
        Buttonsss
      </Button>

      <Radio  label='单个的' checked={singleRadio} onChange={sss}></Radio>
      <CheckboxGroup checkedColor="#1a94bc" name="may" value={checkStatus} onChange={checkBoxChange}>
        {options && options.map((item, index) => {
          return (
            <Checkbox key={index} {...item}></Checkbox>
          )
        })}
      </CheckboxGroup>

      {/* <RadioGroup checkedColor="#f8df72"  rightIcon={true} name="may" value='2' onChange={radioChange}>
        {options && options.map((item, index) => {
          return (
            <Radio key={index} {...item}></Radio>
          )
        })}
      </RadioGroup> */}
    </ScrollView>
  )
}

const styles = StyleSheet.create({
  fontss: {
    fontSize: 18
  }
})